/**
 * Created by John on 2016/7/18.
 */
db.createCollection('log',
    {capped: true, size: 5242880, max: 5000}
);

db.myCollection.ensureIndex(
    {name: 1, number: -1},
    {background: true, unique: true, name: 'myIndex'}
);

db.myCollection.dropIndex({first: 1});

db.myCollection.dropIndex('myIndex');

db.myCollection.dropIndex();

db.runCommand({profile: 1, slowms: 500});

db.system.profile.find();

db.system.profile.find({
    $and: [
        {ts: {$gt: ISODate("2016-07-25T14:20:00.507Z")}},
        {millis: {$lt: 1}}
    ]
});

db.runCommand({top: 1});

db.repareDatabase({
    repairDatabase: 1,
    preserveClonedFilesOnFailure: true,
    backupOriginalFiles: true
});